﻿//  --------------------------------
//  Copyright (c) AW Systems, Inc. All rights reserved.
//  This source code is made available under the terms of the Microsoft Public License (Ms-PL)
//  http://www.codeplex.com/SLAM/license
//  ---------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AWS.SLAM.Configuration
{
    /// <summary>
    /// Represents a field configured for a type managed by SLAM that maps to a column in a SQL database table.
    /// </summary>
    public class SqlMappedField : Field
    {
        /// <summary>
        /// Name of the database table column mapped to this Field.
        /// </summary>
        public string Column { get; set; }

        /// <summary>
        /// The SQL datatype for the mapped column.
        /// </summary>
        public string SqlType { get; set; }

        /// <summary>
        /// Inidicates whether the column may contain null values.  This value should correlate to the
        /// mapped SharePoint Field's Required value.
        /// </summary>
        public bool Required { get; set; }

        /// <summary>
        /// Creates a new SqlMappedField instance.
        /// </summary>
        public SqlMappedField() { }

        /// <summary>
        /// Creates a new SqlMappedField instance with the given Name.
        /// </summary>
        /// <param name="name">The Name of the new field.</param>
        public SqlMappedField(string name)
            : base(name)
        {
        }
    }
}
